import { Button, Checkbox, Form, Input } from 'antd'
import { Store } from 'antd/lib/form/interface'
import React from 'react'
import './index.scss'

const Register = ({ onLogin }: { onLogin: (formData: Store) => void }) => {
  return (
    <>
      <Form name="basic" initialValues={{ remember: false }} onFinish={onLogin}>
        <Form.Item
          label="账号"
          name="userName"
          rules={[{ required: true, message: '请输入您的账号！' }]}
        >
          <Input />
        </Form.Item>

        <Form.Item
          label="密码"
          name="password"
          rules={[{ required: true, message: '请输入您的密码！' }]}
        >
          <Input.Password />
        </Form.Item>

        <Form.Item
          label="请确认密码"
          name="trypassword"
          rules={[{ required: true, message: '请再一次输入您的密码！' }]}
        >
          <Input.Password />
        </Form.Item>

        <Form.Item style={{ textAlign: 'center' }}>
          <Button type="primary" htmlType="submit">
            注册
          </Button>
        </Form.Item>
      </Form>
    </>
  )
}

export default Register
